package main

import (
	"fmt"
	"time"
)

func main() {

	time1 := time.Now()
	var N1, N2 int64
	// 1亿次的整数递增、递减混合运算
	for i := 1; i <= 10; i++ {
		N1, N2 = YyAddSub(0, 100000000)
	}
	fmt.Printf("单次平均耗时：%d ms, 结果:( %d, %d)", time.Now().Sub(time1).Milliseconds()/10, N1, N2)
}

func YyAddSub(N1 int64, N2 int64) (int64, int64) {
	for i := 1; i <= 100000000; i++ {
		N1++
		N2--
	}
	return N1, N2
}
